<script>
	import {
		getToken,
		getVerCode,
		getNumCode
	} from "./api/mini.website";
	
	import config from "./config/server.config";

	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App onShow');
			getNumCode().then(res => {
				var data={username:"editor",password:"123",code:res.data.result};
			    getToken('username=editor&password=123&code='+res.data.result).then(result=>{
			      var token=result.data.tokenType+" "+result.data.token;
				  uni.setStorageSync('token',token);
			      //localStorage.setItem('token',token);
			    }).catch(err => {
			    console.log(err)
			  })
			}).catch(err => {
			  console.log(err)
			})
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "uview-ui/index.scss";
	@import "style/main.scss";
	@import "components/common/timeline/timeLine.scss";
	@import "style/style-view-form.scss";
	@import "colorui/main.css";
	@import "colorui/icon.css";
</style>
